package com.designpattern.structure.Decorator;

/**
 * @author Administration
 * @date 2021/10/18 - 14:01 - 星期一
 * @project lambda
 * @package com.designpattern.structure.Decorator
 * @by 晨
 */
public class test {
    public static void main(String[] args) {
        //点一份炒饭
        FastFood food = new FriedRice();
        System.out.println(food.getDesc() + "  " + food.cost() + "元");

        System.out.println("========");
        //点一份加鸡蛋的炒饭
        food = new Egg(food);
        System.out.println(food.getDesc() + " " + food.cost() + "元");

        System.out.println("========");

        //点一份加培根的炒面
        FastFood fastFood = new FriedNoodles();
        fastFood = new Bacon(fastFood);
        System.out.println(fastFood.getDesc() + " " + fastFood.cost() + "元");
    }

}
